/**
 * @Author Stringzhua
 * @Date 2024/1/31 15:39
 * description:打印1~100之间所有是9的倍数的整数,统计个数以及总和
 */
public class ForExercise {
    /*
     * 化繁为简 输出1~100的和
     * 先死后活
     * */
    public static void main(String[] args) {
        int count = 0;
        int sum = 0;
        int start = 10;
        int end = 200;
        int t = 5;//倍数
        for (int i = start; i <= end; i++) {
            if (i % t == 0) {
//                System.out.println("i = " + i);
                count++;
//                sum += i;
                sum = sum + i;
            }
        }
        System.out.println("个数为" + count + ",和为" + sum);
    }
}